/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hitechbangla.fctu.form;

import com.hitechbangla.fctu.base.PressedButtonEnum;
import com.hitechbangla.fctu.base.radar.AutoLock;
import fctu.simulator.HTB_MAIN;

/**
 *
 * @author Asus
 */
public class RadarTools extends javax.swing.JInternalFrame {

    private HTB_MAIN htb_main;
     public boolean iffSignal = false;
    /**
     * Creates new form RadarTools
     */
    public RadarTools(HTB_MAIN htb_main) 
    {
        super("Radar Tools", true, true, true, true);
	initComponents();
	this.htb_main = htb_main;
        //jButtonEPM.setVisible(false);
        jButtonChangeTrack.setVisible(false);
        jButtonTrackHIstory.setVisible(false);
        Button_selectIFFInfo.setVisible(false);
        Button_SIF.setVisible(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButtonEPM = new javax.swing.JButton();
        jButtonTrackHIstory = new javax.swing.JButton();
        jButtonChangeTrack = new javax.swing.JButton();
        jButtonSelectACInfo = new javax.swing.JButton();
        jButtonAutolock = new javax.swing.JButton();
        jButtonRemoveAutolock = new javax.swing.JButton();
        jButtonGroundAutolock = new javax.swing.JButton();
        jButtonAircraftPathOption = new javax.swing.JButton();
        Button_selectIFFInfo = new javax.swing.JButton();
        Button_ShowIFFSignal = new javax.swing.JButton();
        Button_assignAircraftColor = new javax.swing.JButton();
        Button_SIF = new javax.swing.JButton();
        jButtonGroundAutolock1 = new javax.swing.JButton();

        setTitle("Radar Tools");

        jButtonEPM.setText("EPM");
        jButtonEPM.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonEPMActionPerformed(evt);
            }
        });

        jButtonTrackHIstory.setText("Track History");
        jButtonTrackHIstory.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonTrackHIstoryActionPerformed(evt);
            }
        });

        jButtonChangeTrack.setText("Change Track");

        jButtonSelectACInfo.setText("Select AC Info");
        jButtonSelectACInfo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSelectACInfoActionPerformed(evt);
            }
        });

        jButtonAutolock.setText("Autolock");
        jButtonAutolock.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAutolockActionPerformed(evt);
            }
        });

        jButtonRemoveAutolock.setText("Remove AutoLock");
        jButtonRemoveAutolock.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRemoveAutolockActionPerformed(evt);
            }
        });

        jButtonGroundAutolock.setText("Ground Autolock");
        jButtonGroundAutolock.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGroundAutolockActionPerformed(evt);
            }
        });

        jButtonAircraftPathOption.setText("Aircraft Path Option");
        jButtonAircraftPathOption.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAircraftPathOptionActionPerformed(evt);
            }
        });

        Button_selectIFFInfo.setText("Select IFF Info");
        Button_selectIFFInfo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_selectIFFInfoActionPerformed(evt);
            }
        });

        Button_ShowIFFSignal.setText("Show IFF Signal");
        Button_ShowIFFSignal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_ShowIFFSignalActionPerformed(evt);
            }
        });

        Button_assignAircraftColor.setText("Assign Aircrft Color");
        Button_assignAircraftColor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_assignAircraftColorActionPerformed(evt);
            }
        });

        Button_SIF.setText("SIF");
        Button_SIF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_SIFActionPerformed(evt);
            }
        });

        jButtonGroundAutolock1.setText("Remove AutoLock Ground");
        jButtonGroundAutolock1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGroundAutolock1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButtonSelectACInfo, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Button_selectIFFInfo, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Button_assignAircraftColor, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Button_ShowIFFSignal, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonAircraftPathOption, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonAutolock, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonRemoveAutolock, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonGroundAutolock, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonGroundAutolock1)
                    .addComponent(jButtonEPM, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Button_SIF, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonChangeTrack, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonTrackHIstory, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jButtonSelectACInfo)
                .addGap(7, 7, 7)
                .addComponent(Button_selectIFFInfo)
                .addGap(7, 7, 7)
                .addComponent(Button_assignAircraftColor)
                .addGap(7, 7, 7)
                .addComponent(Button_ShowIFFSignal)
                .addGap(7, 7, 7)
                .addComponent(jButtonAircraftPathOption)
                .addGap(7, 7, 7)
                .addComponent(jButtonAutolock)
                .addGap(7, 7, 7)
                .addComponent(jButtonRemoveAutolock)
                .addGap(7, 7, 7)
                .addComponent(jButtonGroundAutolock, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(3, 3, 3)
                .addComponent(jButtonGroundAutolock1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(3, 3, 3)
                .addComponent(jButtonEPM)
                .addGap(7, 7, 7)
                .addComponent(Button_SIF)
                .addGap(7, 7, 7)
                .addComponent(jButtonChangeTrack)
                .addGap(7, 7, 7)
                .addComponent(jButtonTrackHIstory))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonTrackHIstoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonTrackHIstoryActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButtonTrackHIstoryActionPerformed

    private void jButtonSelectACInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSelectACInfoActionPerformed
        SelectACInfo selectACInfo = new SelectACInfo(htb_main);
	selectACInfo.setVisible(true);
    }//GEN-LAST:event_jButtonSelectACInfoActionPerformed

    private void jButtonAutolockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAutolockActionPerformed
	htb_main.lastPressedButton = PressedButtonEnum.AUTOLOCK;
	
	//Radar radar = htb_main.gameScene.radarList.get(0); 		    
	//AutoLock autoLock = new AutoLock(radar);
	AutoLock autoLock = null;
	AutoLockSelectRadar autoLockSelectRadar = new AutoLockSelectRadar(htb_main, autoLock);
	autoLockSelectRadar.setVisible(true);
	
    }//GEN-LAST:event_jButtonAutolockActionPerformed

    private void jButtonRemoveAutolockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemoveAutolockActionPerformed
	htb_main.lastPressedButton = PressedButtonEnum.REMOVE_AUTOLOCK;
    }//GEN-LAST:event_jButtonRemoveAutolockActionPerformed

    private void jButtonGroundAutolockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGroundAutolockActionPerformed
        /*
	htb_main.lastPressedButton = PressedButtonEnum.AUTOLOCK_GROUND;
	Radar radar = htb_main.gameScene.radarList.get(0);
	
	AutoLockGround autoLockGround = new AutoLockGround(radar);
	*/
	htb_main.lastPressedButton = PressedButtonEnum.AUTOLOCK_GROUND;	
	AutoLockGroundSelectRadar autoLockGroundSelectRadar = new AutoLockGroundSelectRadar(htb_main);
	autoLockGroundSelectRadar.setVisible(true);
	
    }//GEN-LAST:event_jButtonGroundAutolockActionPerformed

    private void jButtonAircraftPathOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAircraftPathOptionActionPerformed
	AircraftPathOption aircraftPathOption = new AircraftPathOption(htb_main);
	aircraftPathOption.setVisible(true);
    }//GEN-LAST:event_jButtonAircraftPathOptionActionPerformed

    private void Button_selectIFFInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_selectIFFInfoActionPerformed
        SelectIFFInfo iffInfo = new SelectIFFInfo(htb_main);
        iffInfo.setVisible(true);
    }//GEN-LAST:event_Button_selectIFFInfoActionPerformed

    private void Button_ShowIFFSignalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_ShowIFFSignalActionPerformed
       
        IFFInformation iifInformation = new IFFInformation(htb_main);
        iifInformation.setVisible(true);
        
        
        //iffSignal = true;
    }//GEN-LAST:event_Button_ShowIFFSignalActionPerformed

    private void Button_assignAircraftColorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_assignAircraftColorActionPerformed
        AircraftColor aircraftColor = new AircraftColor(htb_main);
        aircraftColor.setVisible(true);
    }//GEN-LAST:event_Button_assignAircraftColorActionPerformed

    private void Button_SIFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_SIFActionPerformed
        SIFInformation sifInformation = new SIFInformation(htb_main);
        sifInformation.setVisible(true);
    }//GEN-LAST:event_Button_SIFActionPerformed

    private void jButtonEPMActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEPMActionPerformed
        // TODO add your handling code here:
	
	htb_main.lastPressedButton = PressedButtonEnum.EPM;
    }//GEN-LAST:event_jButtonEPMActionPerformed

    private void jButtonGroundAutolock1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGroundAutolock1ActionPerformed
        htb_main.lastPressedButton = PressedButtonEnum.REMOVE_AUTOLOCK_GROUND;
    }//GEN-LAST:event_jButtonGroundAutolock1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
	/* Set the Nimbus look and feel */
	//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
	 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
	 */
	try {
	    for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
		if ("Nimbus".equals(info.getName())) {
		    javax.swing.UIManager.setLookAndFeel(info.getClassName());
		    break;
		}
	    }
	} catch (ClassNotFoundException ex) {
	    java.util.logging.Logger.getLogger(RadarTools.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	} catch (InstantiationException ex) {
	    java.util.logging.Logger.getLogger(RadarTools.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	} catch (IllegalAccessException ex) {
	    java.util.logging.Logger.getLogger(RadarTools.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	} catch (javax.swing.UnsupportedLookAndFeelException ex) {
	    java.util.logging.Logger.getLogger(RadarTools.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	}
	//</editor-fold>

	/* Create and display the form */
	java.awt.EventQueue.invokeLater(new Runnable() {
	    public void run() {
		//new RadarTools().setVisible(true);
	    }
	});
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Button_SIF;
    private javax.swing.JButton Button_ShowIFFSignal;
    private javax.swing.JButton Button_assignAircraftColor;
    private javax.swing.JButton Button_selectIFFInfo;
    private javax.swing.JButton jButtonAircraftPathOption;
    private javax.swing.JButton jButtonAutolock;
    private javax.swing.JButton jButtonChangeTrack;
    private javax.swing.JButton jButtonEPM;
    private javax.swing.JButton jButtonGroundAutolock;
    private javax.swing.JButton jButtonGroundAutolock1;
    private javax.swing.JButton jButtonRemoveAutolock;
    private javax.swing.JButton jButtonSelectACInfo;
    private javax.swing.JButton jButtonTrackHIstory;
    // End of variables declaration//GEN-END:variables
}
